<?php
require_once("vcl/vcl.inc.php");
require_once("lib/db_connection.php");
//Includes
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");

//Class definition
class Agent_Register extends Page
{
       public $btnSubmit = null;
       public $edpw = null;
       public $edusername = null;
       public $edlname = null;
       public $edfname = null;
       public $Label3 = null;
       public $Label2 = null;
       public $Label1 = null;
       public $Label50 = null;
       public $Image2 = null;

       function clr()
       {
       $this->edusername->Text='';
       $this->edpw->Text='';
       $this->edlname->Text='';
       $this->edfname->Text='';
       }

       function btnSubmitClick($sender, $params)
       {
       $result = mysql_query("INSERT INTO agents_tbl (username,
       password,
       fname,
       lname)

       values
       ('".$this->edusername->Text."',
       '".$this->edpw->Text."',
       '".$this->edfname->Text."',
       '".$this->edlname->Text."')")or die("INSERT AGENT - " . mysql_error());

       echo"<script language=javascript>
       alert('Successfully added record!');
       </script>";
       $this->clr();
       }

}

global $application;

global $Agent_Register;

//Creates the form
$Agent_Register=new Agent_Register($application);

//Read from resource file
$Agent_Register->loadResource(__FILE__);

//Shows the form
$Agent_Register->show();

?>